package edu.pku.sei.transformation.mtparser;

import lpg.runtime.*;

/**
 *<b>
 *<li>Rule 9:  ExtendMode ::= Name based SimpleMode
 *</b>
 */
public class ExtendMode extends Ast implements IExtendMode
{
    private Name _Name;
    private ISimpleMode _SimpleMode;

    public Name getName() { return _Name; }
    public ISimpleMode getSimpleMode() { return _SimpleMode; }

    public ExtendMode(IToken leftIToken, IToken rightIToken,
                      Name _Name,
                      ISimpleMode _SimpleMode)
    {
        super(leftIToken, rightIToken);

        this._Name = _Name;
        this._SimpleMode = _SimpleMode;
        initialize();
    }

    public boolean equals(Object o)
    {
        if (o == this) return true;
        if (! (o instanceof ExtendMode)) return false;
        if (! super.equals(o)) return false;
        ExtendMode other = (ExtendMode) o;
        if (! _Name.equals(other._Name)) return false;
        if (! _SimpleMode.equals(other._SimpleMode)) return false;
        return true;
    }

    public int hashCode()
    {
        int hash = super.hashCode();
        hash = hash * 31 + (_Name.hashCode());
        hash = hash * 31 + (_SimpleMode.hashCode());
        return hash;
    }

    public void accept(Visitor v) { v.visit(this); }
    public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
    public Object accept(ResultVisitor v) { return v.visit(this); }
    public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
}


